package DAO;
import java.sql.*;

public class MYSQLDAOFactory extends DAOFactory {
	
	public static final String DRIVER=
	    "com.mysql.jdbc.Driver";
	  public static final String DBURL=
	    "jdbc:mysql://localhost:3306/apsoo";
	  static String status;
	  
	  // method to create Cloudscape connections
	  public static Connection createConnection() 
	  {
		Connection conn = null;
		
		try
		{
			Class.forName(DRIVER);
			conn = DriverManager.getConnection(DBURL,"root","apsoo");
			
		}	
			catch(SQLException e)
			{
				System.out.println("exceptionSQL");
			}
			catch( ClassNotFoundException e  )
			{
				System.out.println("exceptionNotFound");
			}
			catch(Exception e)
			{
				status = e.getMessage();
			}
	  return conn;
	  }	    
	  
	  String getStatus()
	  {
		  return status;
	  }
	  
	  public HospedeDAO getHospedeDAO() {
	    // CloudscapeCustomerDAO implements CustomerDAO
	    return new MYSQLHospedeDAO();
	  }
	  
	  

}
